home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xmcd-1.4 / libdi.d / vu_tosh.h < prev   
Encoding:
C/C++ Source or Header  |  1995-05-10  |  5.1 KB  |  167 lines

  1. /*
  2.  *   libdi - CD Audio Player Device Interface Library
  3.  *
  4.  *   Copyright (C) 1995  Ti Kan
  5.  *   E-mail: ti@amb.org
  6.  *
  7.  *   This program is free software; you can redistribute it and/or modify
  8.  *   it under the terms of the GNU General Public License as published by
  9.  *   the Free Software Foundation; either version 2 of the License, or
  10.  *   (at your option) any later version.
  11.  *
  12.  *   This program is distributed in the hope that it will be useful,
  13.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *   GNU General Public License for more details.
  16.  *
  17.  *   You should have received a copy of the GNU General Public License
  18.  *   along with this program; if not, write to the Free Software
  19.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  *   The name "Toshiba" is a trademark of Toshiba Corporation, and is
  22.  *   used here for identification purposes only.  This software and its
  23.  *   author are not affiliated in any way with Toshiba.
  24.  *
  25.  */
  26. #ifndef __VU_TOSH_H__
  27. #define __VU_TOSH_H__
  28.  
  29. #ifdef VENDOR_TOSHIBA
  30.  
  31. #ifndef LINT
  32. static char *_vu_tosh_h_ident_ = "@(#)vu_tosh.h    5.2 94/12/28";
  33. #endif
  34.  
  35.  
  36. /* Toshiba vendor-unique commands */
  37. #define OP_VT_AUDSRCH        0xc0    /* Toshiba audio track search */
  38. #define OP_VT_AUDPLAY        0xc1    /* Toshiba play audio */
  39. #define OP_VT_STILL        0xc2    /* Toshiba still */
  40. #define OP_VT_SETSTOP        0xc3    /* Toshiba set stop time */
  41. #define OP_VT_EJECT        0xc4    /* Toshiba caddy eject */
  42. #define OP_VT_RDSUBQ        0xc6    /* Toshiba read status */
  43. #define OP_VT_RDINFO        0xc7    /* Toshiba read disk info */
  44. #define OP_VT_RDMODE        0xc8    /* Toshiba read CDROM mode */
  45.  
  46.  
  47. /* Toshiba audio status codes */
  48. #define TAUD_PLAYING        0x00
  49. #define TAUD_PAUSED        0x01
  50. #define TAUD_SRCH_PAUSED    0x02
  51. #define TAUD_OTHER        0x03
  52.  
  53.  
  54. /* Return data lengths */
  55. #define SZ_VT_RDSUBQ        10    /* Toshiba read sub-code Q data size */
  56. #define SZ_VT_RDINFO        4    /* Toshiba read disc info data size */
  57. #define SZ_VT_RDMODE        1    /* Toshiba read cdrom mode data size */
  58.  
  59.  
  60. /* Toshiba read sub-code Q command data */
  61. typedef struct tsubq_data {
  62.     unsigned int    audio_status:8;    /* audio status */
  63. #if _BYTE_ORDER_ == _L_ENDIAN_
  64.     unsigned int    preemph:1;    /* preemphasis */
  65.     unsigned int    copyallow:1;    /* digital copy allow */
  66.     unsigned int    trktype:1;    /* 0=audio 1=data */
  67.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  68.     unsigned int    reserved:4;    /* reserved */
  69. #else    /* _BYTE_ORDER_ == _B_ENDIAN_ */
  70.     unsigned int    reserved:4;    /* reserved */
  71.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  72.     unsigned int    trktype:1;    /* 0=audio 1=data */
  73.     unsigned int    copyallow:1;    /* digital copy allow */
  74.     unsigned int    preemph:1;    /* preemphasis */
  75. #endif    /* _BYTE_ORDER_ */
  76.     unsigned int    trkno:8;    /* track number (BCD) */
  77.     unsigned int    idxno:8;    /* index number (BCD) */
  78.  
  79.     byte_t        rel_min;    /* trk relative minutes (BCD) */
  80.     byte_t        rel_sec;    /* trk relative seconds (BCD) */
  81.     byte_t        rel_frame;    /* trk relative frame (BCD) */
  82.     byte_t        abs_min;    /* absolute minutes (BCD) */
  83.  
  84.     byte_t        abs_sec;    /* absolute seconds (BCD) */
  85.     byte_t        abs_frame;    /* absolute frame (BCD) */
  86.     byte_t        pad1[2];    /* pad for alignment */
  87. } tsubq_data_t;
  88.  
  89.  
  90. /* Toshiba read disc information command data */
  91. typedef struct tinfo_00 {        /* track information */
  92.     byte_t        first_trk;    /* first track (BCD) */
  93.     byte_t        last_trk;    /* last track (BCD) */
  94.     byte_t        reserved[2];    /* reserved */
  95. } tinfo_00_t;
  96.  
  97. typedef struct tinfo_01 {        /* lead-out track starting time */
  98.     byte_t        min;        /* minutes (BCD) */
  99.     byte_t        sec;        /* seconds (BCD) */
  100.     byte_t        frame;        /* frame (BCD) */
  101.     byte_t        reserved;    /* reserved */
  102. } tinfo_01_t;
  103.  
  104. typedef struct tinfo_02 {        /* specified track starting time */
  105.     byte_t        min;        /* minutes (BCD) */
  106.     byte_t        sec;        /* seconds (BCD) */
  107.     byte_t        frame;        /* frame (BCD) */
  108.     byte_t        reserved;    /* reserved */
  109. } tinfo_02_t;
  110.  
  111.  
  112. /* Argument of Toshiba audio search and play audio commands */
  113. typedef struct taudio_arg {
  114.     union {                /* address */
  115.         word32_t    tp_00;    /* absolute logical blk addr */
  116. #if _BYTE_ORDER_ == _L_ENDIAN_
  117.         struct {
  118.             byte_t    res;    /* reserved */
  119.             byte_t    frame;    /* frame (BCD) */
  120.             byte_t    sec;    /* seconds (BCD) */
  121.             byte_t    min;    /* minutes (BCD) */
  122.         } tp_01;
  123.         struct {
  124.             byte_t    res[3];    /* reserved */
  125.             byte_t    track;    /* track number (BCD) */
  126.         } tp_10;
  127. #else    /* _BYTE_ORDER_ == _B_ENDIAN_ */
  128.         struct {
  129.             byte_t    min;    /* minutes (BCD) */
  130.             byte_t    sec;    /* seconds (BCD) */
  131.             byte_t    frame;    /* frame (BCD) */
  132.             byte_t    res;    /* reserved */
  133.         } tp_01;
  134.         struct {
  135.             byte_t    track;    /* track number (BCD) */
  136.             byte_t    res[3];    /* reserved */
  137.         } tp_10;
  138. #endif    /* _BYTE_ORDER_ */
  139.     } _addr;
  140. } taudio_arg_t;
  141.  
  142. #define    addr_logical    _addr.tp_00
  143. #define    addr_min    _addr.tp_01.min
  144. #define    addr_sec    _addr.tp_01.sec
  145. #define    addr_frame    _addr.tp_01.frame
  146. #define    addr_track    _addr.tp_10.track
  147.  
  148.  
  149. /* Public function prototypes */
  150. extern bool_t    tosh_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,
  151.             byte_t, byte_t);
  152. extern bool_t    tosh_pause_resume(bool_t);
  153. extern bool_t    tosh_get_playstatus(curstat_t *, byte_t *);
  154. extern bool_t    tosh_get_toc(curstat_t *);
  155. extern bool_t    tosh_mute(bool_t);
  156. extern bool_t    tosh_eject(void);
  157. extern void    tosh_init(void);
  158.  
  159. #else
  160.  
  161. #define tosh_init    NULL
  162.  
  163. #endif    /* VENDOR_TOSHIBA */
  164.  
  165. #endif    /* __VU_TOSH_H__ */
  166.  
  167.